<?php

namespace app\shop\controller;

use think\Controller;
use buildView\Detail;
use buildView\Form;
use buildView\Grid;
use app\shop\model\ShopServiceAddress;

/**
 * 自提地址管理
 * Class ServiceAddress
 * @package app\shop\controller
 */
class ServiceAddress extends Controller
{
    /**
     * 列表
     * @auth true
     * @menu true
     * @return string
     */
    public function index()
    {
        $grid = new Grid(new ShopServiceAddress);
		$grid->phone('联系电话');
		$grid->province('省份');
		$grid->city('城市');
		$grid->area('区域');
		$grid->address('详情地址');
		$grid->hideExportButton();
		$grid->actions(function ($action){
            $action->hideDetail();
        });
		$grid->setFromOpen();
		return $grid->view();
    }



    /**
     * 添加/编辑
     * @auth true
     * @menu true
     * @return string
     */
    public function form()
    {
        $form = new Form(new ShopServiceAddress);
		$form->text('phone','联系电话');
		$form->distpicker(['province','city','area'],'区域');
		$form->text('address','详情地址');
        return $form->view();
    }
}
